/* GUI CONVERTED from rwrorp.p (converter v1.76) Mon Sep 17 22:18:42 2001 */
/* rwrorp.p - ROUTING REPORT                                            */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.9.1.4 $                                                   */
/*V8:ConvertMode=FullGUIReport                                          */
/* REVISION: 1.0      LAST MODIFIED: 04/30/86   BY: EMB      */
/* REVISION: 1.0      LAST MODIFIED: 08/29/86   BY: EMB *12* *removed 3/30/88**/
/* REVISION: 2.1      LAST MODIFIED: 10/20/87   BY: WUG *A94**/
/* REVISION: 4.0      LAST MODIFIED: 02/17/88   BY: RL  *A171**/
/* REVISION: 4.0      LAST MODIFIED: 02/24/88   BY: WUG *A175**/
/* REVISION: 4.0      LAST MODIFIED: 03/29/88   BY: EMB *A192**/
/* REVISION: 4.0      LAST MODIFIED: 03/18/88   BY: WUG *A194**/
/* REVISION: 6.0      LAST MODIFIED: 03/06/90   BY: emb *D001**/
/* REVISION: 7.3          LAST EDIT: 02/24/93   BY: sas *G740**/
/* REVISION: 7.4      LAST MODIFIED: 01/12/94   BY: qzl *H276*/
/* REVISION: 7.4      LAST MODIFIED: 06/15/94   BY: pxd *FO86*/
/* REVISION: 7.4      LAST MODIFIED: 12/13/94   BY: pxd *FU54*/
/* REVISION: 7.4      LAST MODIFIED: 03/15/96   BY: jym *H0K6*/
/* REVISION: 8.5      LAST MODIFIED: 07/29/96   BY: *J12T* Sue Poland         */
/* REVISION: 8.6      LAST MODIFIED: 10/15/97   BY: bvm *K104**/
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/12/98   BY: *J326* Sandesh Mahagaokar */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb                */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.9.1.3     BY: Hualin Zhong   DATE: 05/08/01 ECO: *N0YC*        */
/* $Revision: 1.9.1.4 $    BY: Manjusha Inglay  DATE: 08/28/01  ECO: *P01R*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* Note: Changes made here may be necessary in fsrorp.p or fsrorpa.p. */

/* DISPLAY TITLE */

/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rwrorp_p_2 "Effective"
/* MaxLen: Comment: */

&SCOPED-DEFINE rwrorp_p_3 "Print Comments"
/* MaxLen: Comment: */

&SCOPED-DEFINE rwrorp_p_4 "Page Break on Routing"
/* MaxLen: Comment: */

&SCOPED-DEFINE rwrorp_p_6 "Run Rate"
/* MaxLen: Comment: */

&SCOPED-DEFINE rwrorp_p_7 "Tool!Supplier"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable part like ro_routing.
define variable part1 like ro_routing.
define variable wkctr like ro_wkctr.
define variable std_op like ro_std_op.
define variable skpge like mfc_logical initial no
   label {&rwrorp_p_4}.
define variable run_rate as decimal
   format "->>,>>>,>>9.99" label {&rwrorp_p_6}.
define variable printcmmt like mfc_logical initial yes
   label {&rwrorp_p_3}.
define variable i as integer.
define variable effdate like ro_start label {&rwrorp_p_2}.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
part           colon 20
   part1          label {t001.i} skip (1)
   effdate        colon 27
   wkctr          colon 27
   std_op         colon 27
   skpge          colon 27
   printcmmt      colon 27
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).
effdate = today.

{wbrp01.i}


/*GUI*/ {mfguirpa.i true "printer" 132 " " " " " "  }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:


   if part1 = hi_char then part1 = "".

   if c-application-mode <> 'web' then
      
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   {wbrp06.i &command = update &fields = "  part part1 effdate wkctr std_op
          skpge printcmmt" &frm = "a"}

   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data')) then do:

      bcdparm = "".
      {mfquoter.i part   }
      {mfquoter.i part1  }
      {mfquoter.i effdate}
      {mfquoter.i wkctr  }
      {mfquoter.i std_op }
      {mfquoter.i skpge  }
      {mfquoter.i printcmmt}

      if part1 = "" then part1 = hi_char.

   end.

   /* OUTPUT DESTINATION SELECTION */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i "printer" 132 " " " " " " " " }
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



   {mfphead.i}

   for each ro_det where (ro_routing >= part and ro_routing <= part1)
         and (ro_wkctr = wkctr or wkctr = "")
         and (ro_std_op = std_op or std_op = "")
         and ((effdate  = ?) or
             ((effdate  <> ?) and
             (ro_start = ? or ro_start <= effdate) and
             (ro_end   = ? or ro_end >= effdate)))
         no-lock break by ro_routing by ro_op
      with frame b width 134 no-attr-space:

      /* DO NOT INCLUDE SERVICE ROUTINGS ON THIS REPORT */
      if ro_fsm_type <> " " then next.

      if first-of(ro_routing) then do:
         if page-size - line-counter < 6 then page.
         display with frame b STREAM-IO /*GUI*/ .
         find pt_mstr where pt_part = ro_routing no-lock
            no-wait no-error.

         find bom_mstr where bom_parent = ro_routing no-lock no-error.

         put
            {gplblfmt.i &FUNC=getTermLabel(""ROUTING"",11) &CONCAT="': '"}
            ro_routing.

         if available bom_mstr then do:
            put skip.
            if bom_desc <> "" then put bom_desc.
            put skip.
         end.

         if available pt_mstr then put " " pt_desc1 " " pt_desc2.

      end.     /* if first-of (ro_routing) */

      if page-size - line-counter < 2 then page.

      display
         ro_op
         ro_std_op
         ro_desc format "x(18)"
         ro_wkctr ro_mch
         ro_start ro_end
         ro_queue ro_setup ro_run ro_wait ro_move
         ro_yield_pct
         ro_tool column-label {&rwrorp_p_7} WITH STREAM-IO /*GUI*/ .

      if ro_vend > "" then do:
         down 1.
         display ro_vend @ ro_tool column-label {&rwrorp_p_7} WITH STREAM-IO /*GUI*/ .
      end.

      if printcmmt then do:
         for each cmt_det where cmt_indx = ro_cmtindx no-lock:
            do i = 1 to 15:
               if cmt_cmmt[i] <> "" then do:
                  if page-size - line-counter < 1 then do with frame b:
                     page.
                     /* SET EXTERNAL LABELS */
                     setFrameLabels(frame b:handle).
                     display
                        ro_op
                        ro_std_op
                        dynamic-function('getTermLabelFillCentered' in h-label,
                            input "CONTINUE",
                            input 20,
                            input '*') @ ro_desc
                        " " @ ro_wkctr
                        " " @ ro_mch
                        " " @ ro_queue
                        " " @ ro_setup
                        " " @ ro_run
                        " " @ ro_wait
                        " " @ ro_move
                        " " @ ro_yield_pct
                        " " @ ro_tool WITH STREAM-IO /*GUI*/ .
                  end.
                  put cmt_cmmt[i] at 20 skip.
               end.
            end.
            put skip(1).
         end.
      end.     /* if printcmmt */

      if last-of(ro_routing) then do:
         if skpge then page.
      end.

      
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


   end.    /* for each ro_det */

   /* REPORT TRAILER  */
   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


end.   /* mainloop repeat */

{wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" part part1 effdate wkctr std_op skpge printcmmt "} /*Drive the Report*/
